import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  Req,
  HttpException,
  HttpStatus,
} from '@nestjs/common';

import { MessageService } from './message.service';
import { CreateMessageDto } from './dto/message.dto';
import { ApiTags } from '@nestjs/swagger';
@ApiTags('小程序/留言')
@Controller('app/message')
export class MessageController {
  constructor(private readonly messageService: MessageService) {}

  /**
   * 新建留言
   */
  @Post()
  async create(
    @Req() req: Request,
    @Body() createMessageDto: CreateMessageDto,
  ) {
    await this.messageService.create(req.user?.userId, createMessageDto);
  }
}
